rendericon: Fix texture transformation
authorTimm Bäder <mail@baedert.org>
Wed, 11 Oct 2017 07:24:35 +0000 (09:24 +0200)
committerTimm Bäder <mail@baedert.org>
Wed, 11 Oct 2017 07:24:35 +0000 (09:24 +0200)
Use the one from snapshot_icon, which works.

gtk/gtkrendericon.c

index caa700568fecf6e86d7bd8f7d6673be5422df61e..e38c2aa92d4cb9a6094b583fd7766ed9bd41e6c0 100644 (file)
@@ -314,15 +314,16 @@ gtk_css_style_snapshot_icon_texture (GtkCssStyle *style,
     }
   else
     {
-      graphene_matrix_t translate, matrix;
+      graphene_matrix_t m1, m2, m3;
 
       /* XXX: Implement -gtk-icon-transform-origin instead of hardcoding "50% 50%" here */
-      graphene_matrix_init_translate (&translate, &GRAPHENE_POINT3D_INIT (width / 2.0, height / 2.0, 0));
-      graphene_matrix_multiply (&transform_matrix, &translate, &matrix);
-      graphene_matrix_translate (&matrix, &GRAPHENE_POINT3D_INIT(- width / 2.0, - height / 2.0, 0));
-      graphene_matrix_scale (&matrix, 1.0 / texture_scale, 1.0 / texture_scale, 1);
+      graphene_matrix_init_translate (&m1, &GRAPHENE_POINT3D_INIT (width / 2.0, height / 2.0, 0));
+      graphene_matrix_multiply (&transform_matrix, &m1, &m3);
+      graphene_matrix_init_translate (&m2, &GRAPHENE_POINT3D_INIT (- width / 2.0, - height / 2.0, 0));
+      graphene_matrix_multiply (&m2, &m3, &m1);
+      graphene_matrix_scale (&m1, 1.0 / texture_scale, 1.0 / texture_scale, 1);
 
-      gtk_snapshot_push_transform (snapshot, &matrix, "Icon Transform");
+      gtk_snapshot_push_transform (snapshot, &m1, "Icon Transform");
 
       graphene_rect_init (&bounds, 0, 0, gsk_texture_get_width (texture), gsk_texture_get_height (texture));
       gtk_snapshot_append_texture (snapshot, texture, &bounds, "Icon");